package com.gitee.feizns.quickstart.quickio.example;

import com.github.artbits.quickio.api.JTin;
import com.github.artbits.quickio.core.Config;
import com.github.artbits.quickio.core.QuickIO;

import java.io.File;
import java.util.Optional;

/**
 * @author feizns
 * @since 2025/2/13
 */
public class FileExample {

    public static void main(String[] args) {
        try ( JTin tin = QuickIO.tin(Config.of(config -> { config.name("test").path("d:/tmp/tmp/tmp"); }))) {
            tin.put("photo.png", new File("C:\\Users\\28293\\Pictures\\Screenshots\\1.png"));
            File file = tin.get("photo.png");
            Optional.ofNullable(file).ifPresent(f -> QuickIO.println(f.getPath()));
//            file.list
//            Optional.ofNullable(file).ifPresent(f -> QuickIO.println(f.));
        }
    }

}
